package com.tqfframe.datamanage.event.publish;

 import com.tqfframe.datamanage.event.DemoEvent;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Component;

/**
 *  发布事件，通知监听者去调用事件的方法。
 **/
@Component
public class DemoPublisher {

    @Autowired
    ApplicationContext applicationContext;

    public void publish(DemoEvent event) {
        applicationContext.publishEvent(event);
    }
}